# —*— coding: utf-8 -*-

import os

from docx.document import Document

# pip install docxcompose
from docxcompose.composer import Composer

from py_word import Word, py_dir_path, picture_path

if __name__ == '__main__':
    """合并文档：在文档最后追加，保持原有样式"""

    composer = Composer(Word(os.path.join(py_dir_path, 'composer.docx')))

    document: Document = Word(os.path.join(py_dir_path, 'document.docx'))
    composer.append(document)

    composer.save(os.path.join(py_dir_path, 'word.docx'))

    pass
